package com.gw.topicconsumer.service;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component //交给spring容器来管理
public class TopicConsumerService {
    @JmsListener(destination = "ActiveMQTopic")
    public void handleMessage(String name){ //处理topic中的消息
        System.out.println("接收到的name的值为："+name);
    }
}
